/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package action.report;

import static com.opensymphony.xwork2.Action.SUCCESS;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import database.StaffAuthenticationDAO;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import model.Issue;
import model.Staff;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;

/**
 *
 * @author Trang
 */
@Namespace("/Administration/Report")
public class MontlyReportAction extends ActionSupport{
    
     @Action(value = "monthly-report", results = {
        @Result(name = "success", location = "/manageReport/w_montlyReport.jsp")
    })
    public String RevenueBetween() throws ParseException{
        
        Map session = ActionContext.getContext().getSession();
        Staff staff = (Staff) session.get("staff");
        SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
        
        Calendar c = Calendar.getInstance();
        int year = c.get(Calendar.YEAR);
        int month = c.get(Calendar.MONTH);
        String Date = year+"-"+month;
        System.out.println(Date);
        new StaffAuthenticationDAO().addAction("Create Monthly Re", staff.getIdStaff());
        
        return SUCCESS;
    }
}
